package com.w08e.waai.config;

import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: 梦想成为超人的猪猪侠
 * @Date: 2025/7/8 09:00
 */
@Configuration
public class AiConfig {


    @Value("${ai.api.key}")
    private String openAiApiKey;

    @Value("${ai.api.model}")
    private String openAiModel;

    @Bean
    public ChatLanguageModel chatLanguageModel() {
        return OpenAiChatModel.builder()
                .apiKey(openAiApiKey)
                .modelName(openAiModel)
                .temperature(0.7)
                .maxTokens(1000)
                .build();
    }
}
